<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

// Route::middleware('auth:api')->get('/user', function (Request $request) {
//     return $request->user();

// API
Route::group(['namespace'=>'Api','prefix'=>'api','middleware'=>'api'],function (){
    //首页
    Route::any('teacherUp', 'ApiController@teacherUp')->name('api.teacherUp');
    Route::any('courseUp', 'ApiController@courseUp')->name('api.courseUp');

    //老师
    Route::any('teachers/{page?}', 'TeacherController@teachers')->name('api.teachers');
    Route::any('teacherSearch', 'TeacherController@teacherSearch')->name('api.teacherSearch');

    Route::any('teacherIntro', 'TeacherController@teacherIntro')->name('api.teacherIntro');

    //课程
    Route::any('products', 'ProductController@products')->name('api.products');
    Route::any('productSearch', 'ProductController@productSearch')->name('api.productSearch');
    Route::any('evaluation', 'ProductController@evaluation')->name('api.evaluation');

    Route::any('productDetail', 'ProductController@productDetail')->name('api.productDetail');

    //收藏
    Route::any('collect', 'CollectController@collect')->name('api.collect');

    //收藏
    Route::any('evaluate', 'EvaluateController@evaluate')->name('api.evaluate');
});
